<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.mytrip.util.PageInfo" import="com.mytrip.model.OrderHotel" import="java.util.*" import="java.text.SimpleDateFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>出发吧</title>
<jsp:include page="/common/include_js.jsp" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
</head>
<body>
<div id="wrap" style="border:0;">
  <div id="main">
    <div class="fRt rightBar">
    <div class="breadcrumb">您现在的位置：<a href="">出发吧</a> > <a href="">个人中心</a>> 我的机票</div>
    <div class="title">
        <div class="tlText">我的机票</div>
      </div>
      <div class="stdHPad dubVMrgT">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr style="border-bottom:1px solid #DDD;">
          	<td style="width:160px;font-weight:bold;">酒店</td>
          	<td style="width:130px;font-weight:bold;">房间</td>
          	<td style="width:80px;font-weight:bold;">时间</td>
          	<td style="width:80px;font-weight:bold;">预计到店</td>
          	<td style="width:90px;font-weight:bold;">联系人</td>
          	<td style="width:90px;font-weight:bold;">入住人</td>
          	<td style="width:90px;font-weight:bold;">日均价</td>
          	<td style="width:80px;font-weight:bold;">下单时间</td>
          </tr>
          <%
        	PageInfo<OrderHotel> pageInfo = (PageInfo<OrderHotel>)request.getAttribute("orderHotelPage");
        	List<OrderHotel> dataList = pageInfo.getDataList();
        	
        	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        	SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
        	for(OrderHotel orderHotel : dataList){
        %>
          <tr style="border-bottom:1px solid #DDD;">
          	<td style="width:160px;"><%=orderHotel.getHotelName()%><br/><%=orderHotel.getHotelAddress()%></td>
          	<td style="width:130px;"><%=orderHotel.getRoomName()%>&nbsp;(<%=orderHotel.getRoomNum()%>间)</td>
          	<td style="width:80px;"><%=sdf2.format(orderHotel.getCheckInTime())%><br/><%=sdf2.format(orderHotel.getCheckOutTime())%></td>
          	<td style="width:80px;;"><%=orderHotel.getComeTime()%></td>
          	<td style="width:90px;"><%=orderHotel.getNameLx()%><br/><%=orderHotel.getTelLx()%></td>
          	<td style="width:90px;"><%=orderHotel.getNameRz()%><br/><%=orderHotel.getTelRz()%></td>
          	<td style="width:60px;">¥<%=orderHotel.getAvgAmount()%></td>
          	<td><%=sdf.format(orderHotel.getOrderTime())%><br/><a href="javascript:void(0);" onclick="javascript:addToPlan('<%=orderHotel.getHotelName()%>','<%=orderHotel.getRoomName()%>','<%=orderHotel.getHotelAddress()%>','<%=sdf2.format(orderHotel.getCheckInTime())+" "+orderHotel.getComeTime()%>','<%=sdf2.format(orderHotel.getCheckOutTime())+" 12:00"%>');">使用</a></td>
          </tr>
        <%
        	}
        %>
          <tr>
          	<td colspan="4">
          		<%=pageInfo.getHtml()%>
          	</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
  
</div>
<script type="text/javascript">
	var addToPlan=function(hotelName,roomName,hotelAddress,checkInTime,checkOutTime){
		window.opener.writeBack_hotel(hotelName,roomName,hotelAddress,checkInTime,checkOutTime);
		if(confirm('回写成功,是否关闭当前页面？')){
			window.close();
		}
	};
</script>
</body>
</html>
